<?php
defined('PT_ACCESS') or die('No direct access');

class front extends Controller{
	public static function createInstance(){
		$instance = new self();
		return $instance;
	}

	public function dispatch($switch = ''){
		$page = !empty($_GET['page']) ? $_GET['page'] : 'index';
		$action = !empty($_GET['action']) ? $_GET['action'] : 'index';

		if ($switch == ADMIN)
			$this->forward($page, $action, $switch);
		elseif ($switch == 'adlogin')
			$this->forward('users', 'login', 'adlogin');
		else
			$this->forward($page, $action);
	}
}